package com.jiangjiang.eshop.comment.biz;

import com.jiangjiang.eshop.comment.convert.CommentAggregateConvert;
import com.jiangjiang.eshop.comment.dto.CommentAggregateDTO;
import com.jiangjiang.eshop.comment.service.CommentAggregateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @Author Jianghaowen
 * @Date 2021/7/13
 * @Description: TODO
 * @Version V1.0
 **/
@Component
public class CommentAggregateBiz {
    @Autowired
    private CommentAggregateService aggregateService;
    @Autowired
    private CommentAggregateConvert aggregateConvert;
    /**
     * 根据商品id查询评论汇总数据
     * @param goodsId
     * @return
     */
    public CommentAggregateDTO queryByGoodsId(Long goodsId) {
        return aggregateConvert.convert2DTO( aggregateService.queryByGoodsId(goodsId));
    }
}
